package com.education.welco.mapper;

import com.education.welco.pojo.OrderPaper;
import com.education.welco.pojo.OrderUserPaper;
import com.education.welco.pojo.vo.ClassPaper;
import com.education.welco.pojo.vo.WholePaperInfoAppVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderUserPaperMapper {

    public List<OrderUserPaper> OrderUserPaperlist(Integer paper);

    public List<OrderUserPaper> OrderUserPaperlist3(Integer paper);


    public List<OrderUserPaper> OrderUserPaperlist1(Integer userId);

    public int InsertOrderPaper(OrderUserPaper orderUserPaper);

    public List<OrderUserPaper> selectlist(Integer userId);

    public OrderUserPaper SelectOrderUserPaper(@Param("paperId") Integer paperId, @Param("userId") Integer userId);

    public OrderUserPaper SelectOrderUserPaperForInfo(@Param("paperId") Integer paperId, @Param("userId") Integer userId);

    public OrderUserPaper SelectOrderUserPaper1(@Param("paperId") Integer paperId, @Param("userId") Integer userId);

    public int update(OrderUserPaper orderUserPaper);

    public int update2(OrderUserPaper orderUserPaper);

    public int delete(Integer paperId, Integer userId);

    public List<OrderUserPaper> OrderUserPaperlist2(@Param("userId") Integer userId, @Param("paperId") Integer paperId);


    Integer selectCommitPaperNum(@Param("paperId") Integer paperId);

    List<ClassPaper> classPaperList(@Param("paperId") Integer paperId, @Param("classId") Integer classId, @Param("readState") Integer readState);

    String selectTeaIdByCourseId(@Param("courseId") Integer courseId);

    /**
     * 答题完毕后学生查看答题详情
     *
     * @param paperId 试卷id
     * @param stuId   学生用户id
     * @return
     */
    OrderUserPaper exitQuerypaperInfo(@Param("paperId") Integer paperId, @Param("stuId") Integer stuId);

    /**
     * 首页成绩排行  班级与试卷
     *
     * @param paperId
     * @param teaId
     * @param classId
     * @return
     */
    List<OrderUserPaper> homeScoreQueryForTea(@Param("teaId") Integer teaId, @Param("paperId") Integer paperId, @Param("classId") Integer classId);

    /**
     * 老师端首页成绩排行 查找班级下的试卷列表
     */
    List<OrderPaper> selectPaperBoxByClassId(@Param("classId") Integer classId);

    List<WholePaperInfoAppVO> wholePaperInfo(@Param("paperId") Integer paperId, @Param("likeName") String likeName);

    OrderUserPaper selectorderUserPaperById(@Param("stuPaperId") Integer stuPaperId);
}
